<%--
 *  File:    DTPurchaseSalesInvReport.jsp
 *  @Author: Jamesli
 *  Date:    2011/03/10
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>
<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.DTPurchaseSalesInvReport"); 

  //init param
  String strModuleName = "CM";
  String privilegeCode = "R30010";
  String contextPath = request.getContextPath();
%>
<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>

<html>
<head>
<title>DTPurchaseSalesInvReport</title>
<PageFlow:CheckPageFlow pageName="p_dtpurchasesalesinvreport"/>
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<%@ include file="/rpt/ReportURL.inc" %>
<script>
 function page_go(){
	 
	var dtlevel1 = cform.dtlevel1.options[cform.dtlevel1.selectedIndex].innerText;
	var bigzonecode = cform.bigzonecode.options[cform.bigzonecode.selectedIndex].value;
	
	var url = "<%= reportURL%>" + "/frameset?__report=/ovalreport/DTPurchaseSalesInv.rptdesign&sessionid=<%=session.getId()%>&year=" 
			+ cform.year.value + "&month=" + cform.month.value + "&dtlevel1=" + escape(encodeURI(dtlevel1)) ;
	if(!isEmpty(bigzonecode)) url += "&bigzonecode=" + bigzonecode;
    
	document.iframe.location.href = url;
 }
</script>
</head>
<body>
<% //--------------------------------------  page location --%>
	<%@ include file="/inc/PageLocation.inc" %>
<table width="100%" cellspacing="0" border="0" cellpadding="0">
<form name="cform" method="post" action="<%=contextPath %>/Dispatcher"  target="_self">
	<input type="hidden" name="pagename" value="p_dtpurchasesalesinvreport">
	<input type="hidden" name="actionname">
   <tr>
    <td> 
      <table width="100%" border="0" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center" 
style="background:url(<%= contextPath %>/images/<%= strLanguageCode %>/title_2_bg.jpg) repeat-x; " height="36">
         <tr>
         	<td width="20%">&nbsp;</td>
          	<% 
				java.util.Calendar cal = java.util.Calendar.getInstance();      
				String year = cal.get(Calendar.YEAR)+"";     
				String month = cal.get(Calendar.MONTH)+"";
				if(cal.get(Calendar.MONTH) == 0){
					month = "12";
					year = (cal.get(Calendar.YEAR)-1)+"";
				} 
			%>
          	<td class="td_right" width="5%"><%= label.getLabelName("L_Year")%> <font color="red">*</font>：</td>
            <td width="5%">
            	<custom:selectdic property="year" dictType="Years" command="notnull" value="<%=year %>" label="L_Year1"/>
            </td>
         	<td class="td_right" width="5%"><%= label.getLabelName("L_Month")%><font color="red">*</font>：</td>
          	<td width="5%">
            	<custom:selectdic property="month" dictType="Months" command="notnull" value="<%=month %>" label="L_Month"/>
            </td>
         	<td class="td_right" width="5%"><%= label.getLabelName("L_Businessarea") + label.getLabelName("L_Colon") %></td>
            <td width="5%"><custom:select optionInnerTextKey="areaname" optionsName="areas" optionValueKey="areacode" property="bigzonecode" defaultValue="ALL" defaultValueCost=""/></td>
         	<td class="td_right" width="8%"><%= label.getLabelName("L_DealersLevel")%> <font color="red">*</font>:</td>
         	<td width="8%"><custom:selectdic dictType="DealersLevel" property="dtlevel1"/></td>
         	<td width="5%"><a href="javascript:page_go()"><img src="<%= contextPath %>/images/<%= strLanguageCode %>/go_fy.gif" border="0" style="border: 1 solid #000000"></a></td>
         	<td width="*%">&nbsp;</td>
         </tr>
       </table>
    </td>
  </tr>
  </form>
</table>
       <iframe src="<%= contextPath %>/Blank.jsp" frameborder=0 width="100%" height="87%" name="iframe"></iframe>
</body>
</html>